<template>
    <page-body>
        <view class="page">
            <view class="flex benben-position-layout flex flex-wrap align-center paySz_flex_0" :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
                <view class='flex flex-wrap align-center justify-between flex-sub paySz_fd0_0'>
                    <view class='flex flex-wrap align-center paySz_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back" data-url="1">
                        <text class='fu-iconfont2  paySz_fd0_0_c0_c0'>&#xE794;</text>
                    </view>
                    <view class='flex flex-wrap align-stretch justify-center'>
                        <text class='paySz_fd0_0_c1_c0'>支付设置</text>
                    </view>
                    <view class='flex flex-wrap align-center justify-end paySz_fd0_0_c0'>
                    </view>
                </view>

            </view>
            <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
            <!---flex布局flex布局开始-->
            <view class="flex flex-direction align-stretch benben-flex-layout paySz_flex_1">
                <view class='flex flex-wrap align-center paySz_fd1_0'>
                    <view class='flex flex-direction align-stretch'>
                        <text class='paySz_fd1_0_c0_c0'>自动扣款</text>
                        <text class='paySz_fd1_0_c0_c1'>无需手动支付，享快捷支付体验，仅对余额支付生效</text>
                    </view>
                    <benben-switch class='paySz_fd1_0_c1' @change="shezhi" v-model="payType" default-color='#dcdfe6' color='#19C455' :disabled='false' :auto='true' size='80'>
                    </benben-switch>
                </view>
            </view>

            <!---flex布局flex布局结束-->


        </view>
    </page-body>
</template>
<script>
    export default {
        components: {},


        data() {
            return {
                "payType": ''
            };
        },
        computed: {

        },
        watch: {},
        onLoad(options) {
			this.getfdc78c4772da97Func()
        },
        onUnload() {

        },
        onReady() {

        },
        onShow() {

        },
        onHide() {

        },
        onResize() {

        },
        onPullDownRefresh() {

        },
        onReachBottom(e) {

        },
        onPageScroll(e) {

        },
        methods: {
			async shezhi(){
				let datauser = await this.$api.post(global.apiUrls.post5cb54af125f1c, {
					is_auto_deduct : this.payType ? 1 : '0'
				});
				if (datauser.data.code != 1) {
				    this.$message.info(datauser.data.msg);
				    return
				}
			},
			//个人中心-获取会员详细信息
			async getfdc78c4772da97Func() {
			        let datauser = await this.$api.get(global.apiUrls.post5c78c4772da97, {
			
			        });
			
			        if (datauser.data.code != 1) {
			            this.$message.info(datauser.data.msg);
			            return
			        }
			        let infouser = datauser.data;
			        this.payType = infouser.data.is_auto_deduct == 1 ? true : false
					console.log(infouser.data.is_auto_deduct,123)
			},
        }
    };
</script>
<style lang="scss" scoped>
    .page {
        width: 100vw;
        overflow-x: hidden;
        min-height: calc(100vh - var(--window-bottom));
        background: rgba(255, 255, 255, 1);
        background-size: 100% auto;
    }

    .paySz_flex_0 {
        background: #fff;
        width: 750rpx;
        height: 88rpx;
        overflow: hidden;
        z-index: 10;
        top: 0rpx;
        background-size: 100% auto !important;
    }

    .paySz_fd0_0_c1_c0 {
        font-size: 36rpx;
        font-weight: 700;
        color: #333333;
        line-height: 50rpx;
    }

    .paySz_fd0_0_c0_c0 {
        font-size: 36rpx;
        color: #333;
    }

    .paySz_fd0_0_c0 {
        width: 120rpx;
    }

    .paySz_fd0_0 {
        padding: 0rpx 32rpx 0rpx 32rpx;
    }

    .paySz_flex_1 {
        padding: 32rpx;
    }

    ::v-deep .paySz_fd1_0_c1 {
        margin: 0rpx 0rpx 0rpx auto;
    }

    .paySz_fd1_0_c0_c1 {
        color: #999999;
        font-size: 24rpx;
        font-weight: 400;
        margin: 16rpx 0rpx 0rpx 0rpx;
    }

    .paySz_fd1_0_c0_c0 {
        color: #333333;
        font-size: 32rpx;
        font-weight: 500;
    }

    .paySz_fd1_0 {
        border-bottom: 1px solid rgba(238, 238, 238, 1);
		padding: 0 0 32rpx 0;
    }
</style>